{% extends "@EasyWorkflow/base.html.twig" %}
{% block content %}
    <!-- content -->
    <div class="col-md-10">
        <div class="row">
            <div class="col-lg-12">
                <div class="page-header">
                    <h1>系统设置</h1>
                </div>
            </div>
        </div>
        {% include '@EasyWorkflow/_flash_messages.html.twig' %}
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="text-muted bootstrap-admin-box-title">群组列表</div>
                    </div>
                    <div class="bootstrap-admin-panel-content">
                        <div class="row">
                            <div class="col-lg-12">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>群组名称</th>
                                        <th>角色</th>
                                        <th>创建时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% for group in pagination.items %}
                                        <tr>
                                            <th scope="row">{{ group.id }}</th>
                                            <td>{{ group.groupName }}</td>
                                            <td>{{ group.roleNames|join(', ') }}</td>
                                            <td>{{ group.createAt|date('Y-m-d') }}</td>
                                            <td>
                                                <a href="{{ path('group_edit', {id:group.id}) }}"
                                                   class="btn btn-sm btn-primary"><i
                                                            class="glyphicon glyphicon-pencil"></i> 编辑</a>
                                                {% if is_granted('ROLE_LOGIN_USER') %}
                                                    <a href="{{ path('group_delete', {id : group.id}) }}"
                                                       data-toggle="confirmation" data-title="确定要删除该条数据？"
                                                       class="btn btn-danger btn-sm"><i
                                                                class="glyphicon glyphicon-trash"></i> 删除</a>
                                                {% endif %}
                                            </td>
                                        </tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                            <div class="col-lg-12">
                                <div class="clearfix">
                                    {{ knp_pagination_render(pagination) }}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}